use criterion::{criterion_group, criterion_main, Criterion};
use compare_int::compare_int::{int_equal, int_compare};

fn bench_int_equal(c: &mut Criterion) {
    c.bench_function("compare_int_int_equal", |b| {
        b.iter(|| int_equal(&42, &42))
    });
}

fn bench_int_compare_less(c: &mut Criterion) {
    c.bench_function("compare_int_int_compare_less", |b| {
        b.iter(|| int_compare(&10, &20))
    });
}

fn bench_int_compare_equal(c: &mut Criterion) {
    c.bench_function("compare_int_int_compare_equal", |b| {
        b.iter(|| int_compare(&30, &30))
    });
}

fn bench_int_compare_greater(c: &mut Criterion) {
    c.bench_function("compare_int_int_compare_greater", |b| {
        b.iter(|| int_compare(&50, &40))
    });
}

criterion_group!(
    benches,
    bench_int_equal,
    bench_int_compare_less,
    bench_int_compare_equal,
    bench_int_compare_greater
);
criterion_main!(benches);